﻿@model IEnumerable<FloodFree.Common.Sensor>

@{
    ViewBag.Title = @Resources.Resource.AdminMenuSensors;
    Layout = "~/Areas/Admin/Views/Shared/_LayoutAdmin.cshtml";
}

<h2>@Resources.Resource.AdminMenuSensors</h2>

@{
    Html.RenderPartial("_ValidationSummary", ViewData.ModelState);
}


<p>
    @Html.ActionLink(@Resources.Resource.AdminAddSensor, "Create")
</p>

<table class="table table-bordered">
    <tr>
        <th>
            Id
        </th>
        <th>
            UUID
        </th>
        <th>
            Cidade
        </th>
        <th>
            Latitude
        </th>
        <th>
            Longitude
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.SensorId)
        </td>
        <td>
            @Html.ActionLink(item.SensorUUID, "Show", new { id = item.SensorId })
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.City.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Latitude)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Longitude)
        </td>
        <td>
            @Html.ActionLink(@Resources.Resource.Edit, "Edit", new { id=item.SensorId }) |
            @Html.ActionLink(@Resources.Resource.Delete, "Delete", new { id = item.SensorId })
        </td>
    </tr>
}

</table>
